package com.spider.admin.conf;


/**
 * 错误码定义
 */
public enum ResultMessage {

    SUCCESS(200, "操作成功"),
    FAILED(6000, "操作失败"),
    FAILED_UNAUTHORIZED(6001, "未授权"),
    FAILED_AUTH_TOKEN(7001, "Token失效"),
    FAILED_AUTH_SERVICE(7003, "服务未授权"),
    FAILED_PARAMS_VALIDATE(7002, "参数校验失败"),
    FAILED_ES_EXEC(8000, "搜索引擎处理异常"),
    FAILED_OS_EXEC_COMMAND(8001,"执行操作系统命令异常"),
    ERROR_SERVICES(2000, "服务器内部错误");

    //状态码
    private int code;
    //状态描述
    private String message;

    ResultMessage(int code, String message) {
        this.code = code;
        this.message = message;
    }


    @Override
    public String toString() {
        return "ResultMessage{" +
                "code=" + code +
                ", message='" + message + '\'' +
                '}';
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
